<script setup lang="ts" name="PhotoManage">
// 文件系统模块执行文件操作
// import fs from "fs-extra"
import * as fs from "fs"
import { ref } from "vue"
import { createOnlyKey } from "@/utils"
const input = ref("")
const add = () => {
  console.log(789)
  console.log(createOnlyKey())
  const jsonContent = {
    name: "zhangsan"
  }
  fs.writeFile("src/api/json/photoList.json", String(jsonContent), err => {
    if (err) throw err
    console.log("成功")
  })
}
</script>

<template>
  <div class="PhotoManage">
    <el-row :gutter="20">
      <el-col :span="6">
        <el-input v-model="input" round size="large" placeholder="用户名" />
      </el-col>
      <el-col :span="6">
        <el-button type="primary">查询</el-button>
        <el-button>重置</el-button>
        <el-button @click="add">添加</el-button>
      </el-col>
      <el-col :span="6"></el-col>
      <el-col :span="6"></el-col>
    </el-row>
  </div>
</template>

<style scoped lang="scss">
@import "./PhotoManage.scss";
</style>
